package com.backend.service.Impl;


import com.backend.common.LookUpContion;
import com.backend.config.Result;
import com.backend.entity.AssAction;
import com.backend.mapper.ActionMapper;
import com.backend.service.ActionService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ActionServiceImpl implements ActionService {

    @Autowired
    ActionMapper actionMapper;


    @Override
    public Result<List<Map<String,String>>> lookUpUserAllAction(LookUpContion lookUpContion) {
        List<Map<String,String>> actionList=actionMapper.lookUpUserAllAction(lookUpContion);


        return Result.success("查询成功",actionList);
    }

    @Override
    public Result<List<Map<String, String>>> lookUpActionImageById(String actionId) {
        List<Map<String,String>> imageList=actionMapper.lookUpActionImageById(actionId);
        return Result.success("查询成功",imageList);
    }

    @Override
    public Result<List<Map<String, String>>> getAllAction(LookUpContion lookUpContion) {

        PageHelper.startPage(lookUpContion.getPageNum(),lookUpContion.getPageSize());

        List<Map<String,String>> mapList=actionMapper.getAllAction(lookUpContion);

        return Result.success("查询成功",mapList);
    }
}
